package com.community.common.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Administrator
 */
@Controller
public class CommonController {

    @RequestMapping
    public String index(HttpServletResponse response) {
        return "redirect:page/index";
    }

    @ResponseBody
    @RequestMapping("/check")
    public String check(HttpServletResponse response) {
        try {
            return InetAddress.getLocalHost().getHostAddress() + " Working！";
        } catch (UnknownHostException e) {
            return "Working！";
        }
    }

}
